package com.pro.dao;

import com.pro.entity.*;
import com.sun.org.apache.xpath.internal.operations.Bool;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;

/**
 * @author ：刘弘禹
 * @description：TODO
 * @date ：2021/11/15 11:54
 */
public interface UserListMapper {
    //查询所有用户
    public List<BeforeUser> queryBeforeUser(BeforeUser beforeUser);
    //修改用户账号状态
    public Boolean updateStudyDate(@Param("study") Integer study,@Param("id") Integer id);
    //添加封停信息调用ClosureMapper
    //修改用户信息
    public Boolean updateBeforeUser(BeforeUser beforeUser);
    //添加用户
    public Boolean addBeforeUser(BeforeUserPlus beforeUserPlus);
    //添加进思用户。
    public Boolean addUserDevelopment(UserDevelopment userDevelopment);
    //查询优惠券
    public List<UserCoupon> queryCoupons();
    //赠送优惠券
    public Boolean addUserCouponUsed(UserCouponUsed userCouponUsed);
    //赠送完之后优惠券数量减少
    @Update("update js_user_coupon set issue_quantity = " +
            "(select a.issue_quantity from " +
                "(select issue_quantity from js_user_coupon where coupon_id =#{couponId}) as a) - #{num} where coupon_id = #{couponId}")
    public Boolean reduceCoupon(@Param("couponId") Integer couponId,@Param("num") Integer num);
    //查询所有进思用户
    public List<CourseOrderPlus> queryJinSiBeforeUser(BeforeUserPlus beforeUser);
    //查询所有非进思用户
    public List<BeforeUser> queryWrongJinSiBeforeUser(BeforeUserPlus beforeUser);
    //查询前台封停用户信息
    public List<ClosurePlus> queryUserLockoutList(ClosurePlus closurePlus);
    //解封
    @Delete("delete from js_closure where id= #{id}")
    public Boolean unseal(Integer id,Integer userId);
    //添加用户解封记录表
    public Boolean addUnseal(Unseal unseal);
    //前端用户解封日志
    public List<UnsealPlus> queryUnseal(UnsealPlus unsealPlus);
    //删除前端用户解封日志
    @Delete("delete from js_unseal where id = #{id}")
    public Boolean delUnseal(Integer id);
    //获取解封时间
    public List<ClosurePlus> getUnsealingTime();
}
